﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using _2301MVCDemo.Controllers;
using System.Web.Mvc;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            int sum = 1 + 2;
            Assert.AreEqual(3, sum);
        }

        [TestMethod]
        public void TestMethod2()
        {
            DefaultController defaultController = new DefaultController();
            ViewResult result = defaultController.Index() as ViewResult;
            Assert.AreEqual("张三", result.ViewBag.name);
        }
    }
}
